//
//  UserDataModel.h
//  AddressBook
//
//  Created by mac on 2017/8/30.
//  Copyright © 2017年 mac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CompanyModel.h"

@interface UserDataModel : NSObject <NSCoding>

/** 自己的信息 */

/** 身份证 */
@property (nonatomic, copy) NSString *id_card;
/** 昵称 */
@property (nonatomic, copy) NSString *member_name;
/** 手机数组 */
@property (nonatomic, copy) NSArray *phone_name;

/** 所有联系人公司 */
@property (nonatomic, copy) NSArray <CompanyModel *> *data;


/** 字典数据转换成model
 *  @param dic 数据
 *  return model
 */
+ (UserDataModel *)loginModelArrayJsonDic:(NSDictionary *)dic;

/** 保存model到本地
 *  @param model 保存的model
 *  return YES成功
 */
+ (BOOL)saveModel:(UserDataModel *)model;

/** 获取本地model
 *  return nil本地没有model
 */
+ (UserDataModel *)getLocalModel;

/** 清除本地model
 *  return YES成功
 */
+ (BOOL)clearLocalModel;


@end

/*
 {
 code = 10000;
 data =     (
 {
 "com_name" = "\U5e7f\U5dde\U5929\U8109";
 info =             (
 {
 "section_name" = "\U6280\U672f\U90e8";
 "user_name" = "\U8463\U5bcc\U7f8e";
 "user_phone" = 18378164697;
 }
 );
 section =             (
 {
 "section_name" = "\U6280\U672f\U90e8";
 }
 );
 }
 );
 
 userinfo =     {
 "id_card" = 450802199311153620;
 "member_name" = "\U8463\U5bcc\U7f8e";
 "phone_name" =         (
 {
 phone = 18378164697;
 }
 );
 };
 }
 */

/*
{
    code = 10001;
    data = "<null>";
    message = "\U67e5\U8be2\U6210\U529f";
    userinfo =     {
        "id_card" = 450802199999999994;
        "member_name" = "\U554a\U7f8e\U4e86";
        "phone_name" =         (
                                {
                                    phone = 18814134697;
                                }
                                );
    };
}
 */













